//
//  TKIMMsgExt.m
//  TKIM_Thinkive
//
//  Created by liupm on 16/5/18.
//  Copyright © 2016年 liupm. All rights reserved.
//

#import "TKIMMsgExt.h"
#import <objc/runtime.h>

@implementation TKIMMessage(TKIMMsgExt)

-(BOOL)voiceIsListen
{
    NSNumber *isListen = self.ext[@"voiceIsListen"];
    return [isListen boolValue];
}


-(void)setVoiceIsListen:(BOOL)audioIsListen
{
    self.ext[@"voiceIsListen"] = @(audioIsListen);
}


-(NSAttributedString *)attrText
{
    return objc_getAssociatedObject(self, "attrText");
}


-(void)setAttrText:(NSAttributedString *)attrText
{
    objc_setAssociatedObject(self, "attrText", attrText, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}


-(CGSize)size
{
    NSString *sizeStr = objc_getAssociatedObject(self, "size");
    return CGSizeFromString(sizeStr);
}


-(void)setSize:(CGSize)size
{
    objc_setAssociatedObject(self, "size", NSStringFromCGSize(size), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}

@end
